<?php
class RestaurantController extends Zend_Controller_Action
{

    public function init()
    {
        
    }
    public function indexAction()
    {
    	
    }
	//function to show all restaurants in list
	public function listAction()
	{
		$page = $this->_getParam('page');
		if($page == ''){
			$page = 1;
		}
		$criteria = new Criteria();
		$criteria->add(RestaurantPeer::IS_ACTIVE,'Y',Criteria::EQUAL);
		$oCount = RestaurantPeer::doCount($criteria);
		$criteria->setLimit(5);
		$criteria->setOffset(($page-1)*5);
		$oRestaurant = RestaurantPeer::doSelect($criteria);
		
		$this->view->restaurantRes	= $oRestaurant;
		$this->view->page = $page;
		$this->view->count = $oCount;
	}
}